home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / visulztn / saoimage / saoimage.lha / hfiles / control.h < prev    next >
C/C++ Source or Header  |  1990-06-09  |  3KB  |  75 lines

  1. #ifndef lint
  2. static char SccsCtrlId[] = "%W%  %G%";
  3. #endif
  4.  
  5. /* Module:    Control.h
  6.  * Purpose:    Define the struct for event loop control
  7.  * Modified:    {0} Michael VanHilst    initial version         23 December 1988
  8.  *        {1} MVH added generalized connection struct     30 March 1990
  9.  *        {n} <who> -- <does what> -- <when>
  10.  */
  11.  
  12. /* everything needed for single connection to a remote process */
  13. struct connectRec {
  14.   int type;        /* named pipe, socket, or VMS mailbox */
  15.   int protocol;        /* packet type (IRAF, AIPS, HRC, CMD) */
  16.   int fd;        /* file descriptor */
  17.   int open;        /* 0 if closed, else open */
  18.   int direction;    /* read, write, read/write, listen */
  19.   char *name;        /* pipe device name or net socket address */
  20.   int address;        /* network address or parent listener fd */
  21.   void (*func)();    /* function to call when this connection signalled */
  22.   int mask[4];        /* mask bit for file descriptor */
  23.   struct connectRec *next;    /* linklist queue for event handling */
  24.   struct connectRec *affiliate;    /* internal binding for listener/connection */
  25. };
  26.  
  27. struct controlRec {
  28.   int mode;        /* active event response mode */
  29.   int *response;    /* widget returned data pointer */
  30.   int eventmask;    /* current event mask */
  31.   int priority;        /* special event tracking mask */
  32.   int completed;    /* event response completed flag */
  33.   int verbose;        /* print-messages-about-process-statuses */
  34.   int tracking;        /* magnifier and color graph tracking */
  35.   int magni_track;    /* track mouse with magni box */
  36.   int coord_track;    /* track mouse with coord string */
  37.   int print_buttons;    /* include buttons in hardcopy output */
  38.   int printer;        /* PostScript, Imagen Impress, etc. */
  39.   int look_and_feel;    /* SAO, Motif, OpenLook */
  40.  
  41.   int remote_connected;    /* must select for more than just X events */
  42.   int select_size;    /* size of mask to check for event */
  43.   int select_mask[4];    /* combined select masks for all connections */
  44.  
  45.   struct connectRec Xserver;
  46.   struct connectRec IRAF_in;
  47.   struct connectRec IRAF_out;
  48.   struct connectRec AIPS_in;
  49.   struct connectRec AIPS_out;
  50.   struct connectRec aux_in;
  51.   struct connectRec aux_out;
  52.  
  53.   XEvent event;        /* info about most recent X event */
  54. };
  55.  
  56. /* constants used as codes */
  57. #define IOP_pipe    1
  58. #define IOP_socket    2
  59. #define IOP_mailbox    3
  60. #define IOP_SAO        0
  61. #define IOP_Motif    1
  62. #define IOP_OpenLook    2
  63. #define IOP_IRAF    1
  64. #define IOP_Imtool    257
  65. #define IOP_PROS      513
  66. #define IOP_AIPS    8
  67. #define IOP_HRC        16
  68. #define IOP_cmd        32
  69. #define IOP_PostScript 10
  70. #define IOP_Impress    12
  71. /* Write, Read, and ReadWrite are fixed to match code in ctrldisk, ctrlpipe */
  72. #define IOP_Write    1
  73. #define IOP_Read       -1
  74. #define IOP_ReadWrite    0
  75.